package com.lance.answer.gui.answer;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class GkHomework {


    @JsonProperty("code")
    private String code;
    @JsonProperty("content")
    private ContentDTO content;
    @JsonProperty("ts")
    private Long ts;

    @Data
    public static class ContentDTO {
        @JsonProperty("paperInfo")
        private PaperInfoDTO paperInfo;
        @JsonProperty("judgeInfo")
        private JudgeInfoDTO judgeInfo;
        @JsonProperty("answerInfo")
        private AnswerInfoDTO answerInfo;
        @JsonProperty("readoverId")
        private String readoverId;
        @JsonProperty("readoverDate")
        private String readoverDate;

        /**
         *
         */
        @NoArgsConstructor
        @Data
        public static class PaperInfoDTO {
            @JsonProperty("Model")
            private ModelDTO model;
            @JsonProperty("Items")
            private List<ItemsDTO> items;
            @JsonProperty("Sections")
            private List<SectionsDTO> sections;

            @NoArgsConstructor
            @Data
            public static class ModelDTO {
                @JsonProperty("P1")
                private String p1;
                @JsonProperty("P2")
                private String p2;
                @JsonProperty("P3")
                private String p3;
                @JsonProperty("P4")
                private String p4;
                @JsonProperty("P5")
                private Integer p5;
                @JsonProperty("P6")
                private String p6;
            }

            /**
             * ItemsDTO存放的就是正确的答案信息
             */
            @NoArgsConstructor
            @Data
            public static class ItemsDTO {
                @JsonProperty("I1")
                private String i1;
                @JsonProperty("I2")
                private String i2;
                @JsonProperty("I3")
                private Integer i3;
                @JsonProperty("I4")
                private String i4;
                @JsonProperty("I5")
                private String i5;
                @JsonProperty("I6")
                private List<String> i6;
                @JsonProperty("I7")
                private List<String> i7;
                @JsonProperty("I8")
                private List<String> i8;
                @JsonProperty("I9")
                private Integer i9;
                @JsonProperty("I10")
                private String i10;
                @JsonProperty("I11")
                private Integer i11;
                @JsonProperty("I12")
                private String i12;
                @JsonProperty("I13")
                private Double i13;
                @JsonProperty("I14")
                private String i14;
                @JsonProperty("I15")
                private List<?> i15;
                @JsonProperty("I16")
                private Integer i16;
                @JsonProperty("I17")
                private Integer i17;
                @JsonProperty("I18")
                private String i18;
                @JsonProperty("I19")
                private Integer i19;
                @JsonProperty("I20")
                private String i20;
                @JsonProperty("I22")
                private String i22;
                @JsonProperty("I23")
                private String i23;
                @JsonProperty("I25")
                private Integer i25;
                @JsonProperty("I26")
                private Integer i26;
                @JsonProperty("I27")
                private Integer i27;
                @JsonProperty("I28")
                private Integer i28;
                @JsonProperty("I29")
                private String i29;
                @JsonProperty("I30")
                private String i30;
                @JsonProperty("I31")
                private Integer i31;
                @JsonProperty("I32")
                private Integer i32;
                @JsonProperty("I33")
                private String i33;
                @JsonProperty("I34")
                private Integer i34;
                @JsonProperty("I35")
                private Integer i35;
                @JsonProperty("Sub")
                private List<?> sub;
                @JsonProperty("Choices")
                private List<ChoicesDTO> choices;
                @JsonProperty("I24")
                private String i24;
            }

            @NoArgsConstructor
            @Data
            public static class ChoicesDTO {
                @JsonProperty("I1")
                private String i1;
                @JsonProperty("I2")
                private String i2;
                @JsonProperty("Correct")
                private boolean correct;
            }


            /**
             * 存的是每个题型的信息"Sections":[
             * {
             * "Identifier":"S6-26",
             * "Title":"论述题",
             * "Type":6,
             * "Score":12.0,
             * "ItemID":[
             * "0496f4e9-fa7a-432d-96a0-cd74d1c8540f"
             * ]
             * },
             * {
             * "Identifier":"S6",
             * "Title":"问答题",
             * "Type":6,
             * "Score":16.0,
             * "ItemID":[
             * "e438c462-4afa-46ec-b2ed-2641cb8c2229",
             * "1ee8829b-083d-4949-a910-d41ec102ae34"
             * ]
             * },
             * {
             * "Identifier":"S6-8",
             * "Title":"名词解释",
             * "Type":6,
             * "Score":12.0,
             * "ItemID":[
             * "6586ff41-1341-4107-a7e2-f0a4216a0947",
             * "e35a861d-1e2d-4449-96e7-62382f50aa49"
             * ]
             * },
             * {
             * "Identifier":"S3",
             * "Title":"判断题",
             * "Type":3,
             * "Score":30.0,
             * "ItemID":[
             * "37cf442f-68fb-4473-8ec4-a3993864e597",
             * "63e170cd-f5f6-47ba-8be3-2e599e643170",
             * "8bdf0cc8-eddb-423c-8901-55fe00783212",
             * "79581d87-0091-4ec6-8e09-44b14b2c94bc",
             * "24647f66-fd6a-44c1-9f80-b1e3ae338635"
             * ]
             * },
             * {
             * "Identifier":"S1",
             * "Title":"单选题",
             * "Type":1,
             * "Score":30.0,
             * "ItemID":[
             * "e269248b-fdc4-45ea-8d88-35e66b3ae066",
             * "9d0511a6-4e2e-4fce-a386-64f3eae530ec",
             * "97a1e916-620d-41c2-bbb4-cab2205109d6",
             * "ea2c445e-2aae-474e-8e4b-43f3f6b4052c",
             * "d70bfa8d-6159-47ad-87c6-6e98b7f11fa6"
             * ]
             * }
             * ]
             */
            @NoArgsConstructor
            @Data
            public static class SectionsDTO {
                @JsonProperty("Identifier")
                private String identifier;
                @JsonProperty("Title")
                private String title;
                @JsonProperty("Type")
                private Integer type;
                @JsonProperty("Score")
                private Integer score;
                @JsonProperty("ItemID")
                private List<String> itemID;
            }
        }

        @NoArgsConstructor
        @Data
        public static class JudgeInfoDTO {
            @JsonProperty("Items")
            private List<ItemsDTO> items;
            @JsonProperty("TotalScore")
            private Integer totalScore;


            @NoArgsConstructor
            @Data
            public static class ItemsDTO {
                @JsonProperty("I1")
                private String i1;
                @JsonProperty("MarkStatus")
                private Integer markStatus;
                @JsonProperty("I16")
                private Integer i16;
                @JsonProperty("TeacherSay")
                private String teacherSay;
            }
        }

        @NoArgsConstructor
        @Data
        public static class AnswerInfoDTO {
            @JsonProperty("ExamineeId")
            private String examineeId;
            @JsonProperty("AnswerTime")
            private String answerTime;
            @JsonProperty("ItemBankId")
            private String itemBankId;
            @JsonProperty("JudgeType")
            private String judgeType;
            @JsonProperty("Items")
            private List<ItemsDTO> items;
            @JsonProperty("isDecimal")
            private Boolean isDecimal;
            @JsonProperty("isHalf")
            private Boolean isHalf;
            @JsonProperty("CourseId")
            private String courseId;
            @JsonProperty("answerId")
            private Integer answerId;
            @JsonProperty("stuName")
            private String stuName;
            @JsonProperty("subjectiveScore")
            private Integer subjectiveScore;
            @JsonProperty("objectiveScore")
            private Integer objectiveScore;
            @JsonProperty("totalScore")
            private Integer totalScore;

            @NoArgsConstructor
            @Data
            public static class ItemsDTO {
                @JsonProperty("I1")
                private String i1;
                @JsonProperty("I15")
                private List<String> i15;
            }
        }
    }
}
